Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Fix for latest rustc. #114

Closed
wants to merge 1 commit into from
Closed

Fix for latest rustc. #114

wants to merge 1 commit into from

Conversation

dpc
Copy link
Contributor

@dpc dpc commented Jul 20, 2014

I had to change this to build on rustc that I've compiled few hours ago.

@bharrisau
Copy link
Contributor

It looks like we have only just changed to the new index method. Are you sure rustc has been updated? Or did they revert the change?

#112

@bharrisau
Copy link
Contributor

Looks like it was merged a day or two ago rust-lang/rust#15652

@errordeveloper
Copy link
Member

@dpc what is the output of rustc -v and what error message it gives you without this change?

Here is the one I have and Zinc builds without any errors.

rustc -v
rustc 0.12.0-pre-nightly (5e0a597a1a15e36ac7d855ca400e5add9d86716b 2014-07-20 01:06:36 +0000)

@dpc
Copy link
Contributor Author

dpc commented Jul 20, 2014

OK,

So I believe "git pull" failed when I was recompiling.

[futex:zinc]$ rustc -v
rustc 0.12.0-pre (a35774b128df41e49ed3e56690e31dda998d5fdd 2014-07-13
22:46:28 +0000)

But for completeness this is the error:

/home/dpc/lab/rust/zinc/src/main.rs:20:9: 20:20 note: lint level defined
here
/home/dpc/lab/rust/zinc/src/main.rs:20 #![warn(missing_doc)]
^~~~~~~~~~~
rustc --opt-level 2 -Z no-landing-pads --cfg mcu_k20 --cfg arch_cortex_m4
-L /home/dpc/lab/rust/zinc/build --out-dir
/home/dpc/lab/rust/zinc/build /home/dpc/lab/rust/zinc/platformtree/
platformtree.rs
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/pin_pt.rs:93:13: 93:34 error:
cannot index a value of type
&collections::vec::Vec<core::option::Option<std::collections::hashmap::HashMap<collections::string::String,uint>>>
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/pin_pt.rs:93 match
pins[maybe_pin_index] {

^~~~~~~~~~~~~~~~~~~~~
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/pin_pt.rs:105:69: 105:82 error: the
type of this value must be known in this context
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/pin_pt.rs:105 let
avaliable: Vec = pin_funcs.keys().map(|k|{k.to_string()}).collect();

                                          ^~~~~~~~~~~~~

error: aborting due to 2 previous errors
rake aborted!
Command failed with status (101): [rustc --opt-level 2 -Z no-landing-pads
--c...]

Tasks: TOP => build_all => build_blink_k20 =>
/home/dpc/lab/rust/zinc/build/app_blink_k20.bin =>
/home/dpc/lab/rust/zinc/build/app_blink_k20.elf =>
/home/dpc/lab/rust/zinc/build/intermediate/blink_k20/app_blink_k20.o =>
/home/dpc/lab/rust/zinc/build/libmacro_platformtree.so
=> /home/dpc/lab/rust/zinc/build/libplatformtree.rlib
(See full trace by running task with --trace)
make: *** [all] Error 1

I've now did a fresh compilation and I get different error:
[futex:zinc]$ make
rake PLATFORM=k20 build_all
rustc --opt-level 2 -Z no-landing-pads --cfg mcu_k20 --cfg arch_cortex_m4
--target thumbv7em-linux-eabi -Ctarget-cpu=cortex-m4 -C
relocation_model=static -L /home/dpc/lab/rust/zinc/build --out-dir
/home/dpc/lab/rust/zinc/build /home/dpc/lab/rust/zinc/thirdparty/libcore/
lib.rs
rustc --opt-level 2 -Z no-landing-pads --cfg mcu_k20 --cfg arch_cortex_m4
--target thumbv7em-linux-eabi -Ctarget-cpu=cortex-m4 -C
relocation_model=static -L /home/dpc/lab/rust/zinc/build --out-dir
/home/dpc/lab/rust/zinc/build /home/dpc/lab/rust/zinc/thirdparty/librlibc/
lib.rs
rustc --opt-level 2 -Z no-landing-pads --cfg mcu_k20 --cfg arch_cortex_m4
--target thumbv7em-linux-eabi -Ctarget-cpu=cortex-m4 -C
relocation_model=static -L /home/dpc/lab/rust/zinc/build --out-dir
/home/dpc/lab/rust/zinc/build /home/dpc/lab/rust/zinc/src/main.rs
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/peripheral_clock.rs:198:39: 198:52
error: missing lifetime specifier [E0106]
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/peripheral_clock.rs:198 fn
divisor_reg_and_offset(self) -> (&reg::PCLKSEL, u32) {

                      ^~~~~~~~~~~~~

/home/dpc/lab/rust/zinc/src/hal/lpc17xx/uart.rs:116:19: 116:29 error:
missing lifetime specifier [E0106]
/home/dpc/lab/rust/zinc/src/hal/lpc17xx/uart.rs:116 fn reg(self) ->
&reg::UART {

^~~~~~~~~~
/home/dpc/lab/rust/zinc/src/hal/k20/uart.rs:81:19: 81:29 error: missing
lifetime specifier [E0106]
/home/dpc/lab/rust/zinc/src/hal/k20/uart.rs:81 fn reg(self) -> &reg::UART
{
^~~~~~~~~~
error: aborting due to 3 previous errors
rake aborted!
Command failed with status (101): [rustc --opt-level 2 -Z no-landing-pads
--c...]

Tasks: TOP => build_all => build_blink_k20 =>
/home/dpc/lab/rust/zinc/build/app_blink_k20.bin =>
/home/dpc/lab/rust/zinc/build/app_blink_k20.elf =>
/home/dpc/lab/rust/zinc/build/intermediate/blink_k20/app_blink_k20.o =>
/home/dpc/lab/rust/zinc/build/libzinc.rlib
(See full trace by running task with --trace)
make: *** [all] Error 1

with:

[futex:zinc]$ rustc -v
rustc 0.12.0-pre (3a37ed4412f571a079e9d365c226af23dfe9d224 2014-07-20
17:46:32 +0000)

On Sun, Jul 20, 2014 at 11:42 AM, Ilya Dmitrichenko <
[email protected]> wrote:

@dpc https://github.com/dpc what is the output of rustc -v and what
error message it gives you without this change?

Here is the one I have and Zinc builds without any errors.

rustc -v
rustc 0.12.0-pre-nightly (5e0a597a1a15e36ac7d855ca400e5add9d86716b 2014-07-20 01:06:36 +0000)


Reply to this email directly or view it on GitHub
#114 (comment).

Dawid Ciężarkiewicz

@farcaller
Copy link
Member

This is new, rust now automatically infers lots of lifetimes, but 'static lifetimes must now be explicit. I'm closing this PR as it's no longer relevant, I'll merge a fix for lifetimes today.

@farcaller farcaller closed this Jul 21, 2014
@farcaller
Copy link
Member

Specifically, #115 and #116.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants